package com.freak.kotlinfitnessserver.factory.notify

import com.freak.kotlinfitnessserver.constant.fitness.FitnessMachineStatusConstant
import com.freak.kotlinfitnessserver.data.FitnessConfigData
import com.freak.kotlinfitnessserver.data.SportStatusData
import com.freak.kotlinfitnessserver.factory.INotifyFactory

class FitnessMachineStatusNotifyFactory : INotifyFactory {

    override fun getNotifyByteArray(
        sportStatus: Int,
        fitnessConfigData: FitnessConfigData?
    ): ByteArray {
        when (sportStatus) {
            SportStatusData.SPORT_STOP -> {
                return byteArrayOf(
                    FitnessMachineStatusConstant.stoppedOrPausedByTheUser.toByte(),
                    FitnessMachineStatusConstant.stop.toByte()
                )
            }

            SportStatusData.SPORT_PAUSE -> {
                return byteArrayOf(
                    FitnessMachineStatusConstant.stoppedOrPausedByTheUser.toByte(),
                    FitnessMachineStatusConstant.pause.toByte()
                )
            }

            SportStatusData.SPORT_SPORTING -> {
                return byteArrayOf(FitnessMachineStatusConstant.startedOrResumedByTheUser.toByte())
            }
        }
        return ByteArray(0)
    }

    override fun getNotifyByteArrayList(
        sportStatus: Int,
        fitnessConfigData: FitnessConfigData?
    ): List<ByteArray> {
        return ArrayList()
    }
}